﻿using System;
using System.Windows;
using nRoute.Components.Composition;
using nRoute.ViewServices.Contracts;

namespace nRoute.ViewServices.Services
{
    [MapViewService(typeof(IShowMessageViewService), ShowMessageViewService.SERVICE_NAME, 
         InitializationMode = InitializationMode.OnDemand, Lifetime = ViewServiceLifetime.PerInstance)]
    public class ShowMessageViewService
		 : IShowMessageViewService
    {
        private const string SERVICE_NAME = "nRouteMessageBoxViewService";

#region IShowMessageViewService Members

        public string Caption { get; set; }

        public string Text { get; set; }

        public MessageBoxButton ButtonSetup { get; set; }

        public Action<MessageBoxResult> ResponseCallback { get; set; }

        public MessageBoxResult ShowMessage()
        {
            return MessageBox.Show(Text, Caption ?? string.Empty, ButtonSetup);
        }

#endregion

    }
}
